package com.nuoniu.sibanyun.entity.production;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * bom主表
 * </p>
 *
 * @author 小啊刚
 * @since 2021-01-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("mab_bom")
@ApiModel(value="BomMain对象", description="bom主表")
public class ErpBomMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "父件id")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "父件编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "父件名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "1工程BOM 2生产BOM 3成本BOM 4:维修BOM 5:销售BOM")
    @TableField("bom_type")
    private Integer bomType;

    @ApiModelProperty(value = "bom层级")
    @TableField("bom_level")
    private Integer bomLevel;

    @ApiModelProperty(value = "bom用途1:通用2:制造3:委外4:组装5:报价")
    @TableField("bom_use")
    private Integer bomUse;

    @ApiModelProperty(value = "bom工程图")
    @TableField("bom_ed_code")
    private String bomEdCode;

    @ApiModelProperty(value = "bom分组id")
    @TableField("bom_group_id")
    private Integer bomGroupId;

    @ApiModelProperty(value = "bom分组名称")
    @TableField("bom_group_name")
    private String bomGroupName;

    @ApiModelProperty(value = "计量单位id")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位名称")
    @TableField("unit_name")
    private String unitName;

    @ApiModelProperty(value = "生产数量")
    @TableField("produce_quantity")
    private String produceQuantity;

    @ApiModelProperty(value = "成品率(%)")
    @TableField("finish_product_rate")
    private Double finishProductRate;

    @ApiModelProperty(value = "成本")
    @TableField("cost")
    private BigDecimal cost;

    @ApiModelProperty(value = "是否末级")
    @TableField("is_leaf")
    private Integer isLeaf;

    @ApiModelProperty(value = "单价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "含税单价")
    @TableField("tax_price")
    private BigDecimal taxPrice;

    @ApiModelProperty(value = "版本号")
    @TableField("version_code")
    private String versionCode;

    @ApiModelProperty(value = "版本日期")
    @TableField("version_date")
    private String versionDate;

    @ApiModelProperty(value = "生产车间id")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "生产车间名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "工艺路线")
    @TableField("process_route_id")
    private Integer processRouteId;

    @ApiModelProperty(value = "工艺路线名称")
    @TableField("process_route_name")
    private String processRouteName;

    @ApiModelProperty(value = "规格型号")
    @TableField("specification")
    private String specification;

    @ApiModelProperty(value = "状态0:未审核1:已审核")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "是否默认Bom")
    @TableField("is_default_bom")
    private Integer isDefaultBom;

    @ApiModelProperty(value = "审核人id")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人名称")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "审核人时间")
    @TableField("reviewer_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "创建人id")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人名称")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "修改人")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "修改人姓名")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_date")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "bom明细")
    @TableField(exist = false)
    private List<ErpBomDetail> orderDetailList;

    @ApiModelProperty(value = "搜索关键字")
    @TableField(exist = false)
    private String searchKey;
}
